.TH std::chrono::year_month 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::chrono::year_month \- std::chrono::year_month

.SH Synopsis
   Defined in header <chrono>
   class year_month;           \fI(since C++20)\fP

   The class year_month represents a specific month of a specific year, but with an
   unspecified day. It is a field-based time point, with a resolution of
   std::chrono::months.

   year_month is a TriviallyCopyable StandardLayoutType.

.SH Member functions

   constructor   constructs a year_month
                 \fI(public member function)\fP
   year          accesses the stored year and month
   month         \fI(public member function)\fP
   operator+=    modifies the year_month by some number of months or years
   operator-=    \fI(public member function)\fP
   ok            checks if this year_month is valid
                 \fI(public member function)\fP

   Nonmember functions

   operator==  compares two year_month values
   operator<=> \fI(function)\fP
   (C++20)
   operator+   performs arithmetic on year_month
   operator-   \fI(function)\fP
   (C++20)
   operator<<  outputs a year_month into a stream
   (C++20)     \fI(function template)\fP
   from_stream parses a year_month from a stream according to the provided format
   (C++20)     \fI(function template)\fP

.SH Helper classes

   std::formatter<std::chrono::year_month> formatting support for year_month
   (C++20)                                 \fI(class template specialization)\fP
   std::hash<std::chrono::year_month>      hash support for std::chrono::year_month
   (C++26)                                 \fI(class template specialization)\fP
